import java.math.BigDecimal;
import java.util.Map;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import top.infopub.job.fia.service.PayBillService;
import top.infopub.job.fia.service.ProBudgetService;
import top.infopub.job.util.ParserUtil;

import com.google.common.collect.Maps;

/*
 * 文件名：ProBudgetServiceJunit.java
 * 版权：Copyright by www.yunshows.com
 * 描述：
 * 修改人：Awoke
 * 修改时间：2020年2月18日
 * 跟踪单号：
 * 修改单号：
 * 修改内容：
 */

public class ProBudgetServiceJunit extends BasicSpringJunitTest {

    @Autowired
    ProBudgetService proBudgetService;
    
    @Autowired
    PayBillService payBillService;

    @Test
    public void test() {
        Map<String, Object> areaBudgetWhere = Maps.newHashMap();
        areaBudgetWhere.put("belongsYear", ParserUtil.getYearOfPrevMonth());
        areaBudgetWhere.put("months", ParserUtil.getMonthOfPrevMonth());
        areaBudgetWhere.put("hrOrgAreaId", "9B8AF2425FB455AFE053F40313ACD9F4");
        /*BigDecimal areaBudget = proBudgetService.sumMonthFinFeeOfArea(areaBudgetWhere);
        if (areaBudget == null || areaBudget.compareTo(BigDecimal.ZERO) == 0) {
            System.out.println("[区域]经营质量分析指标-融资额 数据归集时，公司预算不存在~");
        }
        else{
            System.out.println(areaBudget);
        }*/
        
        Map<String, Object> proQaWhere = Maps.newHashMap();
        proQaWhere.put("payDateStart", ParserUtil.prevMonth());
        proQaWhere.put("payDateEnd", ParserUtil.currentMonth());
        proQaWhere.put("hrOrgProId", "9B8AF2425FB455AFE053F40313ACD9F4");
        proQaWhere.put("singleType", "27");
        BigDecimal proQaOfCashOut = payBillService.selectProSingleOfInvest(proQaWhere);
        System.out.println(proQaOfCashOut);
        
        proQaWhere.put("singleType", "28,29");
        BigDecimal proQaOfCashOut1 = payBillService.selectProSingleOfInvest(proQaWhere);
        System.out.println(proQaOfCashOut1);
        
    }
    
}
